package com.randb.easyhttp.callback;

import com.randb.easyhttp.exception.ApiException;
import com.randb.easyhttp.utils.Utils;

import java.lang.reflect.Type;

/**
 * User: RandBII
 * Date: 2020/5/8
 * Description:
 */
public abstract class Callback<T> implements IType<T> {

    public abstract void onStart();

    public abstract void onFinish();

    public abstract void onSuccess(T t);

    public abstract void onError(ApiException e);

    @Override
    public Type getType() {
        return Utils.findNeedClass(getClass());
    }

    public Type getRawType() {
        return Utils.findRawType(getClass());
    }
}
